void main() {
  ADPCFG = 0xFFFF;                             // initialize AN pins as digital
  TRISD = 0xFFFF;                              // initialize portd as input
  TRISB = 0x0000;                              // initialize portb as output

  do {
     if(PORTD)
     {
        LATB=~LATB;
        delay_ms(200);
     }

  } while(1);
}




